<template>
  <v-container fluid class="pa-0" style="height: calc(100vh - 100px);">

    <AiCompanionChat
        v-if="isPageActive"
        style="height: 100%;"
    />

  </v-container>
</template>

<script setup>
import {ref, onMounted, onUnmounted} from 'vue';
import AiCompanionChat from '@/components/AiCompanionChat.vue';

const isPageActive = ref(false);

// 当组件挂载时（即用户进入/chat页面），激活它
onMounted(() => {
  isPageActive.value = true;
});

// 当组件卸载时（即用户离开/chat页面），取消激活
onUnmounted(() => {
  isPageActive.value = false;
});
</script>